package com.example.controller;

import com.example.pojo.GoodsImages;
import com.example.pojo.Result;
import com.example.service.GoodsImagesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/goods-images")
public class GoodsImagesController {

    @Autowired
    private GoodsImagesService goodsImagesService;

    @GetMapping
    public Result<List<GoodsImages>> getGoodsImagesByGoodsGoodsId(@RequestParam Integer goodsGoodsId) {
        List<GoodsImages> goodsImagesList = goodsImagesService.getGoodsImagesByGoodsGoodsId(goodsGoodsId);
        return Result.success(goodsImagesList);
    }
}